<p id="title"><?php  echo $this->title; ?>  </p>
<form method="POST" name="boo">

<?php
$action = 'insert';
if (isset ( $this->objectData )) {
	$action = 'update';
}
?>
<input type="hidden" name="actiontype" value="<?php echo $action;?>" />
	<input type="hidden" name="Point_id" id="point_id"
		value="<?php echo $this->bind('id')?>">
	<div class="elem">
		<label for="point_name"> <?php echo Resource::getResource('point');?> </label> <input type="text"
			name="Point_name" id="point_name"
			value="<?php echo $this->bind('name')?>">
	</div>
	<div class="elem">
		<label for="point_route" style="width: 100%;"> <?php echo Resource::getResource('route'); ?> </label> 	
			
		<select name="Point_route" id="point_route" style="width: 75%;">
				<?php		
					foreach ($this->relativeData as $entity) {
						if ($this->bind('route') == $entity['routeid'])
							echo '<option selected="selected" value="'.$entity['routeid'].'" >'.$entity['pointstart'].' - '.$entity['pointend'].'</option>';
						else
							echo '<option value="'.$entity['routeid'].'">'.$entity['pointstart'].' - '.$entity['pointend'].'</option>';
					}					
				?>
			</select>
	</div>
	
	<?php if($action=='insert')
		echo '<input type="hidden" name="Point_status" id="point_status" value="1">';
	?>
	<button type="submit" onclick="document.boo.submit()" style="display: none;">Save</button>
</form>
